﻿using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;

namespace B.S.BaseData.Read.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class GetUserInfoController : ControllerBase
    {
        [HttpGet]
        public IActionResult GetUserInfo()
        {
            var userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var userName = User.FindFirst(ClaimTypes.Name)?.Value;

            return Ok(new { userId, userName });
        }
    }
}
